package com.hghivln.erpwarehouse.business.controller;


import com.hghivln.erpwarehouse.business.entity.Outport;
import com.hghivln.erpwarehouse.business.service.OutportService;
import com.hghivln.erpwarehouse.business.vo.OutportVo;
import com.hghivln.erpwarehouse.system.common.lang.Result;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author hghivln
 * @since 2021-07-10
 */
@RestController
@RequestMapping("api/outport")
public class OutportController {

    @Autowired
    private OutportService outportService;

    @RequestMapping("loadAllOutport")
    public Object loadAllOutport(OutportVo outportVo) {
        return outportService.queryAllOutport(outportVo);
    }

    @RequiresPermissions("outport:add")
    @RequestMapping("addOutport")
    public Result addOutport(Outport outport) {
        try {
            outportService.addOutport(outport);
            return Result.ADD_SUCCESS;
        } catch (Exception e) {
            e.printStackTrace();
            return Result.ADD_ERROR;
        }
    }
}
